package com.lianbang.pharmacy.dialog

import android.os.Bundle
import android.view.View
import cn.ubest.mvvmcore.base.BaseDialogFragment
import cn.ubest.mvvmcore.utils.DoubleClickHelper
import cn.ubest.mvvmcore.utils.ResourcesUtils
import com.lianbang.pharmacy.R
import com.lianbang.pharmacy.databinding.DialogSignBinding

/**
 * Created by maoqi on 2020/12/17.
 */
class SignDialog : BaseDialogFragment<DialogSignBinding>() {

    companion object {

        fun newInstance(score: String): SignDialog {
            val dialog = SignDialog()
            dialog.arguments = Bundle().run {
                putString("score", score)
                this
            }
            return dialog
        }
    }

    override fun initLayout(): Int {
        return R.layout.dialog_sign
    }

    override fun initData(arguments: Bundle?) {
    }

    override fun initView(view: View) {
        setWidth(ResourcesUtils.getDimens(R.dimen.dp_260))
        mBinding?.btnSubmit?.setOnClickListener(object : DoubleClickHelper.OnClickListener() {
            override fun onClicked(view: View?) {
                finishSelf()
            }
        })
        mBinding?.tvScore?.text = "${arguments?.getString("score") ?: ""}积分"
    }

    override fun loadData() {
    }

}